namespace ::

function Guess { n Int, N Int } $[Null] {
    @await guess = GetInt(String('Enter a number between 0 and ', (N - 1))),
    if ((guess == n)) {
        ShowInfo('Correct!')
    } else {
        let tip = if ((guess < n)) { 'Too Small!' } else { 'Too Big!' },
        @await ShowInfo(tip),
        Guess(n, N)
    }
}

entry {
    let N = 100,
    @await n = Random(N),
    Guess(n, N)
}


